package cn.scw.project.system.mapper;

import cn.scw.project.system.domain.SysUser;
import cn.scw.project.system.domain.SysUserBrokerage;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 每日佣金Mapper接口
 *
 * @author api
 * @date 2020-05-20
 */
public interface SysUserBrokerageMapper
{
    /**
     * 查询每日佣金
     *
     * @param id 每日佣金ID
     * @return 每日佣金
     */
    public SysUserBrokerage selectSysUserBrokerageById(Long id);

    /**
     * 查询每日佣金列表
     *
     * @return 每日佣金集合
     */
    public List<SysUserBrokerage> selectSysUserBrokerageList(Long userId);

    /**
     * 新增每日佣金
     *
     * @param sysUserBrokerage 每日佣金
     * @return 结果
     */
    public int insertSysUserBrokerage(SysUserBrokerage sysUserBrokerage);

    /**
     * 修改每日佣金
     *
     * @param sysUserBrokerage 每日佣金
     * @return 结果
     */
    public int updateSysUserBrokerage(SysUserBrokerage sysUserBrokerage);

    /**
     * 删除每日佣金
     *
     * @param id 每日佣金ID
     * @return 结果
     */
    public int deleteSysUserBrokerageById(Long id);

    /**
     * 批量删除每日佣金
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteSysUserBrokerageByIds(Long[] ids);

    SysUserBrokerage selectSysUserBrokerageByUserAndDate(@Param("userId") Long userId, @Param("date") Date date);

    List<SysUserBrokerage> selectByDateAndIsPay(Date date, boolean isPay);

    double countAll(SysUser user);

    double countAllByDealer(SysUser user);
}
